//
//  MeHeaderView.swift
//  iPhone
//
//  Created by Toj on 5/15/23.
//

import Foundation
import UIKit

class MeHeaderView: UITableViewHeaderFooterView {
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        
        setupMakeAddSubviews()
        setupMakeInitialize()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        setupMakeLayoutSubviews()
    }
    
    /* TitleLabel */
    private(set) lazy var titleLabel: UILabel = {
        let view = UILabel()
        view.textColor = .black
        view.font = 20.to_boldFont
        view.textAlignment = .left
        return view
    }()
}

// MARK: - 初始化设置
private extension MeHeaderView {
    
    func setupMakeAddSubviews() {
        addSubview(titleLabel)
    }
    
    func setupMakeLayoutSubviews() {
        titleLabel.snp.makeConstraints { make in
            make.left.right.equalTo(self).inset(5)
            make.top.bottom.equalTo(self)
        }
    }
    
    func setupMakeInitialize() {
        backgroundColor = .white
    }
}
